//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class CRGBA {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CRGBA(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CRGBA obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CRGBA(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CRGBA() {
    this(nelmiscJNI.new_CRGBA__SWIG_0(), true);
  }

  public CRGBA(short r, short g, short b, short a) {
    this(nelmiscJNI.new_CRGBA__SWIG_1(r, g, b, a), true);
  }

  public CRGBA(short r, short g, short b) {
    this(nelmiscJNI.new_CRGBA__SWIG_2(r, g, b), true);
  }

  public void setPacked(long packed) {
    nelmiscJNI.CRGBA_setPacked(swigCPtr, this, packed);
  }

  public long getPacked() {
    return nelmiscJNI.CRGBA_getPacked(swigCPtr, this);
  }

  public boolean lt(CRGBA c) {
    return nelmiscJNI.CRGBA_lt(swigCPtr, this, CRGBA.getCPtr(c), c);
  }

  public boolean notEqual(CRGBA c) {
    return nelmiscJNI.CRGBA_notEqual(swigCPtr, this, CRGBA.getCPtr(c), c);
  }

  public boolean isEqual(CRGBA c) {
    return nelmiscJNI.CRGBA_isEqual(swigCPtr, this, CRGBA.getCPtr(c), c);
  }

  public void serial(IStream f) {
    nelmiscJNI.CRGBA_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void blendFromui(CRGBA c0, CRGBA c1, long coef) {
    nelmiscJNI.CRGBA_blendFromui(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1, coef);
  }

  public void modulateFromui(CRGBA c0, long a) {
    nelmiscJNI.CRGBA_modulateFromui(swigCPtr, this, CRGBA.getCPtr(c0), c0, a);
  }

  public void modulateFromColor(CRGBA c0, CRGBA c1) {
    nelmiscJNI.CRGBA_modulateFromColor(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1);
  }

  public void set(short r, short g, short b, short a) {
    nelmiscJNI.CRGBA_set__SWIG_0(swigCPtr, this, r, g, b, a);
  }

  public void set(short r, short g, short b) {
    nelmiscJNI.CRGBA_set__SWIG_1(swigCPtr, this, r, g, b);
  }

  public short toGray() {
    return nelmiscJNI.CRGBA_toGray(swigCPtr, this);
  }

  public long get565() {
    return nelmiscJNI.CRGBA_get565(swigCPtr, this);
  }

  public void set565(long col) {
    nelmiscJNI.CRGBA_set565(swigCPtr, this, col);
  }

  public void avg2(CRGBA a, CRGBA b) {
    nelmiscJNI.CRGBA_avg2(swigCPtr, this, CRGBA.getCPtr(a), a, CRGBA.getCPtr(b), b);
  }

  public void avg4(CRGBA a, CRGBA b, CRGBA c, CRGBA d) {
    nelmiscJNI.CRGBA_avg4(swigCPtr, this, CRGBA.getCPtr(a), a, CRGBA.getCPtr(b), b, CRGBA.getCPtr(c), c, CRGBA.getCPtr(d), d);
  }

  public void add(CRGBA c0, CRGBA c1) {
    nelmiscJNI.CRGBA_add(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1);
  }

  public void sub(CRGBA c0, CRGBA c1) {
    nelmiscJNI.CRGBA_sub(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1);
  }

  public void blendFromuiRGBOnly(CRGBA c0, CRGBA c1, long coef) {
    nelmiscJNI.CRGBA_blendFromuiRGBOnly(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1, coef);
  }

  public void modulateFromuiRGBOnly(CRGBA c0, long a) {
    nelmiscJNI.CRGBA_modulateFromuiRGBOnly(swigCPtr, this, CRGBA.getCPtr(c0), c0, a);
  }

  public void modulateFromColorRGBOnly(CRGBA c0, CRGBA c1) {
    nelmiscJNI.CRGBA_modulateFromColorRGBOnly(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1);
  }

  public void avg2RGBOnly(CRGBA a, CRGBA b) {
    nelmiscJNI.CRGBA_avg2RGBOnly(swigCPtr, this, CRGBA.getCPtr(a), a, CRGBA.getCPtr(b), b);
  }

  public void avg4RGBOnly(CRGBA a, CRGBA b, CRGBA c, CRGBA d) {
    nelmiscJNI.CRGBA_avg4RGBOnly(swigCPtr, this, CRGBA.getCPtr(a), a, CRGBA.getCPtr(b), b, CRGBA.getCPtr(c), c, CRGBA.getCPtr(d), d);
  }

  public void addRGBOnly(CRGBA c0, CRGBA c1) {
    nelmiscJNI.CRGBA_addRGBOnly(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1);
  }

  public void subRGBOnly(CRGBA c0, CRGBA c1) {
    nelmiscJNI.CRGBA_subRGBOnly(swigCPtr, this, CRGBA.getCPtr(c0), c0, CRGBA.getCPtr(c1), c1);
  }

  public static void addColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride, long destStride, long dup) {
    nelmiscJNI.CRGBA_addColors__SWIG_0(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride, destStride, dup);
  }

  public static void addColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride, long destStride) {
    nelmiscJNI.CRGBA_addColors__SWIG_1(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride, destStride);
  }

  public static void addColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride) {
    nelmiscJNI.CRGBA_addColors__SWIG_2(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride);
  }

  public static void addColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors) {
    nelmiscJNI.CRGBA_addColors__SWIG_3(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors);
  }

  public static void modulateColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride, long destStride, long dup) {
    nelmiscJNI.CRGBA_modulateColors__SWIG_0(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride, destStride, dup);
  }

  public static void modulateColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride, long destStride) {
    nelmiscJNI.CRGBA_modulateColors__SWIG_1(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride, destStride);
  }

  public static void modulateColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride) {
    nelmiscJNI.CRGBA_modulateColors__SWIG_2(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride);
  }

  public static void modulateColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors) {
    nelmiscJNI.CRGBA_modulateColors__SWIG_3(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors);
  }

  public static void subtractColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride, long destStride, long dup) {
    nelmiscJNI.CRGBA_subtractColors__SWIG_0(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride, destStride, dup);
  }

  public static void subtractColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride, long destStride) {
    nelmiscJNI.CRGBA_subtractColors__SWIG_1(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride, destStride);
  }

  public static void subtractColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors, long srcStride) {
    nelmiscJNI.CRGBA_subtractColors__SWIG_2(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors, srcStride);
  }

  public static void subtractColors(CRGBA dest, CRGBA src1, CRGBA src2, long numColors) {
    nelmiscJNI.CRGBA_subtractColors__SWIG_3(CRGBA.getCPtr(dest), dest, CRGBA.getCPtr(src1), src1, CRGBA.getCPtr(src2), src2, numColors);
  }

  public boolean convertToHLS(SWIGTYPE_p_float h, SWIGTYPE_p_float l, SWIGTYPE_p_float S) {
    return nelmiscJNI.CRGBA_convertToHLS(swigCPtr, this, SWIGTYPE_p_float.getCPtr(h), SWIGTYPE_p_float.getCPtr(l), SWIGTYPE_p_float.getCPtr(S));
  }

  public void buildFromHLS(float h, float l, float s) {
    nelmiscJNI.CRGBA_buildFromHLS(swigCPtr, this, h, l, s);
  }

  public void swapBR() {
    nelmiscJNI.CRGBA_swapBR(swigCPtr, this);
  }

  public void setR(short value) {
    nelmiscJNI.CRGBA_R_set(swigCPtr, this, value);
  }

  public short getR() {
    return nelmiscJNI.CRGBA_R_get(swigCPtr, this);
  }

  public void setG(short value) {
    nelmiscJNI.CRGBA_G_set(swigCPtr, this, value);
  }

  public short getG() {
    return nelmiscJNI.CRGBA_G_get(swigCPtr, this);
  }

  public void setB(short value) {
    nelmiscJNI.CRGBA_B_set(swigCPtr, this, value);
  }

  public short getB() {
    return nelmiscJNI.CRGBA_B_get(swigCPtr, this);
  }

  public void setA(short value) {
    nelmiscJNI.CRGBA_A_set(swigCPtr, this, value);
  }

  public short getA() {
    return nelmiscJNI.CRGBA_A_get(swigCPtr, this);
  }

  public static CRGBA getBlack() {
    long cPtr = nelmiscJNI.CRGBA_Black_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getRed() {
    long cPtr = nelmiscJNI.CRGBA_Red_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getGreen() {
    long cPtr = nelmiscJNI.CRGBA_Green_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getYellow() {
    long cPtr = nelmiscJNI.CRGBA_Yellow_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getBlue() {
    long cPtr = nelmiscJNI.CRGBA_Blue_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getMagenta() {
    long cPtr = nelmiscJNI.CRGBA_Magenta_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getCyan() {
    long cPtr = nelmiscJNI.CRGBA_Cyan_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public static CRGBA getWhite() {
    long cPtr = nelmiscJNI.CRGBA_White_get();
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

}
